package cn.wolfcode.car.business.web.controller;


import cn.wolfcode.car.business.domain.StockBill;
import cn.wolfcode.car.business.domain.StockBillItem;
import cn.wolfcode.car.business.query.StockBillItemQuery;
import cn.wolfcode.car.business.service.IStockBillItemService;
import cn.wolfcode.car.business.service.IStockBillService;
import cn.wolfcode.car.business.service.IStoreService;
import cn.wolfcode.car.common.base.page.TablePageInfo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 岗位控制器
 */
@Controller
@RequestMapping("business/stockBillItem")
public class StockBillItemController {
    //模板前缀
    private static final String prefix = "business/stockBillItem/";

    @Autowired
    private IStockBillItemService stockBillItemService;
    @Autowired
    private IStockBillService stockBillService;
    @Autowired
    private IStoreService storeService;


    @RequestMapping("/query")
    @ResponseBody
    public TablePageInfo<StockBillItem> query(StockBillItemQuery query){
        return stockBillItemService.query(query);
    }

    @RequestMapping("/listPage")
    public String listPage(Model model,Long id){
        StockBill stockBill = stockBillService.selectByBillId(id);
        model.addAttribute("stockBill",stockBill);
        return prefix + "list";
    }



}
